﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace ContosoUniversity.Models
{
    //定义一个枚举类
    public enum Grade
    {

        A,B,C,D,E,F
    }

    public class Enrollment
    {
        public int EnrollmentID { get; set; }
        public int CourseID { get; set; }
        public int StudentID { get; set; }

        //枚举Grade,?表示允许空值
        [DisplayFormat(NullDisplayText = "No Grade")]
        public Grade? Grade { get; set; }

        //定义外键关系
        public virtual Student Student { get; set; }
        public virtual Course Course { get; set; }
      
    }
}